<template>
  <!-- 文件导出命名 -->
  <el-dialog
    v-model="downLoadPop"
    title="导出配置"
    width="500px"
    :close-on-click-modal="false"
    :close-on-press-escape="false"
    :append-to-body="true"
  >
    <div class="rowBC">
      <div class="col-flex-8">
        <div class="mb-1">文件名称</div>
        <el-input v-model="downLoadName" placeholder="请输入导出文件名" class="mr-2"></el-input>
      </div>
      <div class="col-flex-3 offer-1">
        <div class="mb-1">文件类型</div>
        <el-select v-model="fileTypeIndex" placeholder="请选择">
          <el-option v-for="item in fileType" :key="item" :label="item" :value="item"></el-option>
        </el-select>
      </div>
    </div>
    <template #footer>
      <div class="dialog-footer">
        <el-button :loading="exportLoading" @click="exportComfirn(0)">默认导出</el-button>
        <el-button type="primary" :loading="exportLoading" @click="exportComfirn(1)">确 定</el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script>
export default {
  name: 'exportDialog'
}
</script>
<script setup>
import excelExport from './export'

let props = defineProps({
  // 工具栏相关--------
  downLoadMethod: { // 下载方法 get || post
    type: String,
    default: 'get'
  },
  downLoadUrl: { // 下载地址
    type: String,
    default: ''
  },
  responseType: {
    type: String,
    default: 'bold'
  },
  isDownLoadFile: {
    type: Boolean,
    default: true
  }
})
const {downLoadPop,downLoadName,fileTypeIndex,fileType,exportLoading,exportComfirn} = excelExport(props)
defineExpose({
  downLoadPop
})
</script>

<style scoped>

</style>
